﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using JuCheap.Core.Infrastructure;
using JuCheap.Core.Models.Filters;
using JuCheap.Core.Models.ViewModels;
using JuCheap.Core.Data.Entity;

namespace JuCheap.Core.Interfaces
{
    public interface IRepository
    {


        Task<PagedResult<WorkerViewModel>> GetWorkers(WorkerFilter filter);
        Task<WorkerViewModel> AddWorker(WorkerViewModel worker);
        Task<WorkerViewModel> UpdateWorker(WorkerViewModel worker);
        Task DeleteWorker(int id);

        Task<PagedResult<JobPositionViewModel>> GetJobPositions(JobPositionFilter filter);
        Task<JobPositionViewModel> AddJobPosition(JobPositionViewModel jobPosition);
        Task<JobPositionViewModel> UpdateJobPosition(JobPositionViewModel jobPosition);
        Task DeleteJobPosition(int jobPositionId);

        Task<PagedResult<JobPositionTypeViewModel>> GetJobPositionTypes(JobPositionTypeFilter filter);
        Task<JobPositionTypeViewModel> AddJobPositionType(JobPositionTypeViewModel jobPositionType);
        Task<JobPositionTypeViewModel> UpdateJobPositionType(JobPositionTypeViewModel jobPositionType);
        Task DeleteJobPositionType(int jobPositionTypeId);

        Task<PagedResult<HardWareDeviceViewModel>> GetHardWareDevices(HardWareDeviceFilter filter);
        Task<HardWareDeviceViewModel> AddHardWareDevice(HardWareDeviceViewModel hardWareDevice);
        Task<HardWareDeviceViewModel> UpdateHardWareDevice(HardWareDeviceViewModel hardWareDevice);
        Task DeleteHardWareDevice(int hardWareDeviceId);

        /// <summary>
        /// 批量添加员工到组
        /// </summary>
        /// <param name="workers">员工组列表， key为组名， value为员工phone number</param>
        /// <returns></returns>
        Task ImportWorkerToGroup(IReadOnlyList<KeyValuePair<string, string>> workers);
        Task<PagedResult<DepartmentGroupViewModel>> GetDepartmentGroups(DepartmentGroupFilter filter);
        Task<DepartmentGroupViewModel> AddDepartmentGroup(DepartmentGroupViewModel departmentGroup);
        Task<DepartmentGroupViewModel> UpdateDepartmentGroup(DepartmentGroupViewModel departmentGroup);
        Task DeleteDepartmentGroup(int departmentGroupId);

        Task<PagedResult<CompanyViewModel>> GetCompanys(CompanyFilter filter);
        Task<CompanyViewModel> AddCompany(CompanyViewModel company);
        Task<CompanyViewModel> UpdateCompany(CompanyViewModel company);
        Task DeleteCompany(int companyId);

        Task<PagedResult<OrganizationViewModel>> GetOrganizations(OrganizationFilter filter);
        Task<OrganizationViewModel> AddOrganization(OrganizationViewModel organization);
        Task<OrganizationViewModel> UpdateOrganization(OrganizationViewModel organization);
        Task DeleteOrganization(int organizationId);

        Task<PagedResult<BanCiViewModel>> GetBanCis(BanCiFilter filter);
        Task<BanCiViewModel> AddBanCi(BanCiViewModel banCi);
        Task<BanCiViewModel> UpdateBanCi(BanCiViewModel banCi);
        Task DeleteBanCi(int banCiId);

        Task<PagedResult<PaiBanViewModel>> GetPaiBans(PaiBanFilter filter);
        Task<PaiBanViewModel> AddPaiBan(PaiBanViewModel paiBan);
        Task<PaiBanViewModel> UpdatePaiBan(PaiBanViewModel paiBan);
        Task DeletePaiBan(int paiBanId);

        Task<PagedResult<TimePeriodViewModel>> GetTimePeriods(TimePeriodFilter filter);
        Task<TimePeriodViewModel> AddTimePeriod(TimePeriodViewModel timePeriod);
        Task<TimePeriodViewModel> UpdateTimePeriod(TimePeriodViewModel timePeriod);
        Task DeleteTimePeriod(int timePeriodId);


        Task<string> GetAllRecords(string type, string size, string date);

        Task<DepartmentGroupWorker> GetDepartmentGroupWoker(int groupID);
    }
        
}
